//
//  BaseViewController.swift
//  Mediaplayer
//
//  Created by bin hu on 2025/7/8.
//

import UIKit

public func xlog(_ lastMessage: @autoclosure () -> Any,
                 file: StaticString = #file,
                 line: UInt = #line) {
#if DEBUG
    let xxx = "\(file)"
    let x_x = xxx.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? ""
    debugPrint("🌹🌹 文件：\(x_x) _.^._ 第\(line)行 _.^._ 日志信息：\(lastMessage()) 🌹🌹")
#endif
}

class BaseViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        self.view.theme_backgroundColor = "Colors.backgroundColor"
        //解决往上偏移导航栏高度问题
        self.extendedLayoutIncludesOpaqueBars = true
        self .edgesForExtendedLayout = UIRectEdge . init (rawValue: 0 )
        //防止以上方法导致需要透明的导航栏变黑
        self.navigationController?.navigationBar.isTranslucent = false
        self.tabBarController?.tabBar.isTranslucent = false
        //iOS 11以上需要...
        if #available(iOS 11.0, *) {
            
        }
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

    deinit {
        xlog("❤️❤️❤️❤️❤️❤️❤️❤️ \(self.classForCoder)释放了...")
    }

}
